#include <iostream>
using namespace std;

signed main()
{
    int n,m;
    cin>>n>>m;
    int a[1000] = {0};
    for(int i=0;i<m;i++){
        for(int j=0;j<n;j++){
            int t;
            cin>>t;
            a[j] += t;
        }
    }
    int maxa = 0;
    for(int i=0;i<n;i++)    maxa = max(maxa,a[i]);
    int ans[1000],cnt = 0;
    for(int i=0;i<n;i++)    if(a[i]==maxa)    ans[cnt++] = i+1;
    cout<<maxa<<"\n";
    cout<<ans[0];
    for(int i=1;i<cnt;i++)    cout<<" "<<ans[i];
    return 0;
}
